﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace AntMovement.Core.Entity
{
    [Serializable]
    public class AxisStatus
    {
        /// <summary>
        /// 轴运动状态
        /// </summary>
        public bool SportStatus { get; set; }

        private bool enable = false;
        /// <summary>
        /// 轴使能状态
        /// </summary>
        public bool Enable
        {
            get { return enable; }
            set
            {
                enable = value;
            }
        }

        private bool alm = false;
        /// <summary>
        /// 伺服报警信号0
        /// </summary>
        public bool Alm
        {
            get
            {
                return alm;
            }
            set
            {
                alm = value;
            }
        }
        /// <summary>
        /// 正硬限位信号1
        /// </summary>
        public bool El_Left { get; set; } = false;
        /// <summary>
        /// 负硬限位信号2
        /// </summary>
        public bool El_Right { get; set; } = false;

        /// <summary>
        /// 急停信号3  EMGS
        /// </summary>
        public bool EMG { get; set; }

        /// <summary>
        /// 原点信号4
        /// </summary>
        public bool ORG { get; set; }

        /// <summary>
        /// 正软限位6
        /// </summary>
        public bool SL_Left { get; set; } = false;
        /// <summary>
        /// 负软限位7
        /// </summary>
        public bool SL_Right { get; set; } = false;
        /// <summary>
        /// 伺服到位信号8 PEND
        /// </summary>
        public bool INP { get; set; } = false;
        /// <summary>
        /// EZ信号9
        /// </summary>
        public bool EZ { get; set; } = false;
        /// <summary>
        /// 伺服准备信号10 保留 CRDY
        /// </summary>
        public bool RDY { get; set; } = false;
        /// <summary>
        /// 减速停止信号11 保留
        /// </summary>
        public bool DSTP { get; set; } = false;

        /// <summary>
        /// 回零状态
        /// </summary>
        public bool Homing { get; set; } = false;

        /// <summary>
        /// 原点复位完成
        /// </summary>
        public bool HEND { get; set; } = false;

        /// <summary>
        /// 当前速度
        /// </summary>
        public double CurrentSpeed { get; set; } = 0;

        /// <summary>
        /// 当前位置
        /// </summary>
        public long CurrentPostion { get; set; }

        /// <summary>
        /// 指令计数源
        /// </summary>
        public long EqPostion { get; set; } = 0;
        public bool IsJog { get; set; } = false;
        public bool IsHome { get; set; } = false;
        public bool IsMove { get; set; } = false;
    }
}
